package nc.ui.hyszsf.report.xsjk;

import nc.ui.bd.ref.AbstractRefGridTreeModel;
import nc.ui.bd.ref.AbstractRefTreeModel;
import nc.vo.bd.ref.RefIconConfigVO;
import nc.vo.ml.NCLangRes4VoTransl;

public class WdRefModel extends AbstractRefTreeModel {
	
	public WdRefModel(String refNodeName)
    {
        setRefNodeName(refNodeName);
    }

	public void setRefNodeName(String refNodeName)
    {
//		m_strRefNodeName = refNodeName;
//		
//		setRootName( refNodeName );
//		setClassFieldCode(new String[] {
//                "doccode", "docname", "pk_defdoc1", "pk_corp", "pk_defdoc"
//            });
//		setFatherField("pk_defdoc1");
//        setChildField("pk_defdoc");
//        setClassTableName("bd_defdoc");
//        setClassWherePart(" pk_corp='0001' and pk_defdoclist='0001A1100000000004MU' ");
//        setClassDefaultFieldCount(2);
//        setFieldCode(new String[] {
//                "doccode", "docname"
//        	});
//        setPkFieldCode("pk_defdoc");
		

        m_strRefNodeName = refNodeName;
        setFieldCode(new String[] {
            "doccode", "docname"
        });
        setHiddenFieldCode(new String[] {
            "pk_defdoc", "pk_defdoc1"
        });
        setFatherField("pk_defdoc1");
        setChildField("pk_defdoc");
        setPkFieldCode("pk_defdoc");
        setStrPatch("distinct");
//        setRefTitle(NCLangRes4VoTransl.getNCLangRes().getStrByID("ref", "UPPref-000004"));
        setStrPatch("distinct");

        setTableName("bd_defdoc");
        setWherePart(" pk_defdoclist='0001A1100000000004MU' ");

//        setTableName("bd_corp INNER JOIN sm_user_role ON bd_corp.pk_corp = sm_user_role.pk_corp ");
//        setWherePart((new StringBuilder()).append("bd_corp.ishasaccount='Y'and sm_user_role.cuserid ='").append(getPk_user()).append("' ").toString());

        
//        RefIconConfigVO iconcfgVO = new RefIconConfigVO();
//        iconcfgVO.setIconKey("\u6811.\u516C\u53F8\u76EE\u5F55");
//        setIconCfgVO(iconcfgVO);
//        resetFieldName();
    
    }
	
	public String getRefTitle()
    {
        setFieldName(null);
        resetFieldName();
        setRefTitle(null);
        return super.getRefTitle();
    }
	
}
